Skip to content

HDDS-14919. Add a base class for all the SCM handler interfaces#10050

Open
Russole wants to merge 1 commit intoapache:masterfrom
Russole:HDDS-14919
Open

HDDS-14919. Add a base class for all the SCM handler interfaces#10050
Russole wants to merge 1 commit intoapache:masterfrom
Russole:HDDS-14919

Conversation

@Russole
Copy link
Copy Markdown
Contributor

@Russole Russole commented Apr 5, 2026

What changes were proposed in this pull request?

  • Introduce a common SCMHandler interface with a getType() method for SCM handlers
  • Move RequestType from external parameters to handler implementations
  • Refactor getProxyHandler(...) to derive RequestType from the handler instead of passing it explicitly
  • Update existing handlers, invokers, and tests to align with the new design

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14919

How was this patch tested?

@Russole
Copy link
Copy Markdown
Contributor Author

Russole commented Apr 5, 2026

Hi @szetszwo, could you please help review this PR when you have time? Thanks!

Copy link
Copy Markdown
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good. (See the next comment.)

Copy link
Copy Markdown
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Russole , on second thought, it is better to move up the getType() implementations; see the comments inlined. Found that when I was updating the code generator (HDDS-14973).

this.ratisHandler = ratisHandler;
}

public abstract RequestType getType();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should implement getType() here instead of adding it to all the subclasses:

  public final RequestType getType() {
    return getImpl().getType();
  }

* manage deleted blocks and record them in the underlying persist store.
*/
public interface DeletedBlockLogStateManager {
public interface DeletedBlockLogStateManager extends SCMHandler {
Copy link
Copy Markdown
Contributor

@szetszwo szetszwo Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Similarly, we should implement getType() here instead of the subclasses.
  • We should do it for all the handler interfaces.
  @Override
  default RequestType getType() {
    return RequestType.BLOCK;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants